#ifndef __RecordManager_h__
#define __RecordManager_h__

#include <fstream>
#include <vector>
#include <algorithm>

#define MAXNAME 3 // Maximos caracteres del nombre del jugador
#define MAXRECORDS 6 // Maximos records almacenados

// Estructura de un record
typedef struct {
	char name[MAXNAME + 1];
	int score;
} Record;

class RecordManager {
	private:
		RecordManager(); // Singleton
		
		static RecordManager* _recordManagerInstance; // Singleton
		std::vector<Record>* _recordVector;
		
	public:
		~RecordManager();

		static RecordManager* getRecordManager(); // Singleton		
		void readRecords(const std::string& recordFilePath);
		static bool compareRecord(Record r1, Record r2);
		void insertRecord(char* name, int score);
		std::vector<Record>* getRecords() const;
		void writeRecords(const std::string& recordFilePath);
};

#endif

